package cm.studapp.fragments;

import java.util.Calendar;

import cm.studapp.NewSchedule;

import android.app.Dialog;
import android.app.TimePickerDialog;
import android.app.TimePickerDialog.OnTimeSetListener;
import android.os.Bundle;
import android.support.v4.app.*;
import android.text.format.DateFormat;
import android.text.format.Time;
import android.widget.TimePicker;
public class TimePickerFragment extends DialogFragment implements TimePickerDialog.OnTimeSetListener {

	private int owner;
	
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
// Use the current time as the default values for the picker
final Calendar c = Calendar.getInstance();
int hour = c.get(Calendar.HOUR_OF_DAY);
int minute = c.get(Calendar.MINUTE);

TimePickerDialog time= new TimePickerDialog(getActivity(), this, hour, minute,
		DateFormat.is24HourFormat(getActivity()));
// Create a new instance of TimePickerDialog and return it
return time;
}

@Override
public void onTimeSet(TimePicker view, int hourOfDay, int minute) {
	NewSchedule mn =(NewSchedule)this.getActivity();
	mn.setTime(owner,hourOfDay, minute);
}



public void setIdOwner(int t){
	owner = t;
	
}
}